package com.k.base.jdk.functions.demo3;

import java.util.function.Consumer;

public class FastAutoGen {
    private final DataSourceConfig.Builder dataSourceConfigBuilder ;
    private final PackageConfig.Builder packageConfigBuilder;

    private FastAutoGen(){
        dataSourceConfigBuilder = DataSourceConfig.newBuilder();
        packageConfigBuilder = PackageConfig.newBuilder();
    }

    public FastAutoGen dataSourceConfig(Consumer<DataSourceConfig.Builder> consumer) {
        consumer.accept(this.dataSourceConfigBuilder);
        return this;
    }
    public FastAutoGen packageConfig(Consumer<PackageConfig.Builder> consumer) {
        consumer.accept(this.packageConfigBuilder);
        return this;
    }
    public static FastAutoGen create(){
        return new FastAutoGen();
    }

    public FastAutoGen gen(){
        System.out.println("gen");
        System.out.println("dataSourceConfig:"+dataSourceConfigBuilder.build());
        System.out.println("packageConfig:"+packageConfigBuilder.build());
        return this;
    }
}
